const str = "hello World"

//获取索引为6这个字符
console.log(str.charAt(6))  //W


let str2 = "abcdefg";
console.log(str2.charCodeAt(1)); //  --> 98   //b的Ascill码是98
console.log(str2.charCodeAt(10)); //NaN   //没有字符则返回NaN